package com.sand.entity;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "userdetails", schema = "ssh_pro", catalog = "")
public class UserdetailsEntity {
    /**
     * @author <achao1441470436@gmail.com>
     * @since 2021/11/28/028 14:46
     */
    private int rid;
    private int userId;
    private String name;
    private int sex;
    private String idCard;
    private String jobInfo;
    private String avater;
    private Long balance;

    @Id
    @Column(name = "rid")
    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    @Basic
    @Column(name = "userId")
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "sex")
    public int getSex() {
        return sex;
    }

    public void setSex(int sex) {
        this.sex = sex;
    }

    @Basic
    @Column(name = "idCard")
    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    @Basic
    @Column(name = "jobInfo")
    public String getJobInfo() {
        return jobInfo;
    }

    public void setJobInfo(String jobInfo) {
        this.jobInfo = jobInfo;
    }

    @Basic
    @Column(name = "avater")
    public String getAvater() {
        return avater;
    }

    public void setAvater(String avater) {
        this.avater = avater;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserdetailsEntity that = (UserdetailsEntity) o;
        return rid == that.rid && userId == that.userId && sex == that.sex && Objects.equals(name, that.name) && Objects.equals(idCard, that.idCard) && Objects.equals(jobInfo, that.jobInfo) && Objects.equals(avater, that.avater);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rid, userId, name, sex, idCard, jobInfo, avater);
    }

    @Basic
    @Column(name = "balance")
    public Long getBalance() {
        return balance;
    }

    public void setBalance(Long balance) {
        this.balance = balance;
    }
}
